# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Thijs Vermeir <thijsvermeir@gmail.com>
# Contributor: Denis Zawada <deno@rootnode.net>

pkgname=gupnp-av
pkgver=0.12.11+3+g2123c81
pkgrel=1
pkgdesc="Library to ease handling and implementation of UPnP A/V profiles"
url="https://wiki.gnome.org/Projects/GUPnP"
arch=(x86_64)
license=(LGPL)
depends=(glib2 libxml2)
makedepends=(gobject-introspection gtk-doc vala meson git)
_commit=2123c810fa2129f77f907e9cc9107982e29e8ee6  # master
source=("git+https://gitlab.gnome.org/GNOME/gupnp-av.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gupnp-av-//;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build
}

package() {
  depends+=(libg{lib,object}-2.0.so)
  provides+=(libgupnp-av-1.0.so)

  DESTDIR="$pkgdir" meson install -C build
}
